# 两个数之和
def two_sum(nums, target):
    for i in range(len(nums)):
        for j in range(i + 1, len(nums)):
            if nums[i] + nums[j] == target:
                return [i, j]
    return None


nums = [2, 7, 11, 15]
# 在目标值相同列表中找出两个整数
print(two_sum(nums, 18))
